<template>
	<view class="content">
		<button @click="onCallFunction">调用云函数</button>
		<button @click="onCallObj">调用云对象</button>
	</view>
</template>

<script setup>
	const onCallFunction = async ()=>{
		const result = await uniCloud.callFunction({
			name:"hello",
			data:{
				message:"这个是来自客户端的数据"
			}
		});
		console.log(result);
	};

	const helloObj = uniCloud.importObject("helloObj");
	const onCallObj = async ()=>{
		const result = await helloObj.add("新增", "内容");
		console.log(result);
		return result;
	};
	
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
